#ifndef _MY_STRING_H_
#define _MY_STRING_H_

#include "../stdaxf.h"

class MyString
{
public:
	static char* strrev(char* s);
	static void split(const std::string& s, std::string delim, std::vector< std::string >* ret);
	static int chartoint(unsigned char chr, unsigned char *cint);
	static int hexstrtodata(unsigned char *str, unsigned char *data, int len, int flag);
	static int convert(unsigned char *dst, const unsigned char *src, int length);
	static unsigned long HextoDec(const unsigned char *hex, int length, bool isBig = true);
	// 字符串 转义多少个字符
	static int DectoHex(int dec, unsigned char *hex, int length, bool isBig = true);
	static unsigned long power(int base, int times);
	static unsigned long  BCDtoDec(const unsigned char *bcd, int length);
	static int DectoBCD(int Dec, unsigned char *Bcd, int length);
	static void convertUnCharToChar(unsigned char* UnChar, int ucLen, char* str);
	static void convertCharToUnChar(char* str, unsigned char* UnChar);
	static std::string convert_hex(unsigned char *md, int nLen);
    static unsigned int reversebytes_uint32t(unsigned int value);
	static void vector_string_to_vector_double(const std::vector<std::string>& in, std::vector<double> &out);
	static void vector_double_to_vector_string(const std::vector<double> &in, std::vector<std::string>& out);
	static std::string vector_double_to_string(const std::vector<double> &in, const std::string &split);
	static std::string vector_string_to_string(const std::vector<std::string> &in, const std::string &split);
	static void string_replace(std::string &strBig, const std::string &strsrc, const std::string &strdst);
#ifdef  WIN32
	// 需要外部删除返回结果
	static char * wchar2char(const wchar_t* wchar);
	static wchar_t * char2wchar(const char* cchar);
#endif //  WIN32
};

#endif
